<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>模板内置对象 方便使用request session</title>
</head>
<body>
<div style="margin-left: 350px">
    <h3>内置对象 #request,#seesion,session的使用</h3>
    <p>获取作用域中的数据</p>
    <p th:text="${#request.getAttribute('requestData')}"></p>
    <p th:text="${#session.getAttribute('sessionData')}"></p>
    <p th:text="${session.loginname}"></p>

    <br/>
    <br/>
    <h3>使用内置对象的方法</h3>
    getRequestURL=<span th:text="${#request.getRequestURL()}"></span><br/>
    getRequestURL=<span th:text="${#request.getRequestURI()}"></span><br/>
    getQueryString=<span th:text="${#request.getQueryString()}"></span><br/>
    getContextPath=<span th:text="${#request.getContextPath()}"></span><br/>
    getServerName=<span th:text="${#request.getServerName()}"></span><br/>
    getServerPort=<span th:text="${#request.getServerPort()}"></span><br/>
    sessionId,getId=<span th:text="${#session.getId()}"></span>


    <h3>param对象：表示请求的参数集合</h3>
    name参数的值：<span th:text="${param.name}"></span><br/>
    参数的数量：<span th:text="${param.size()}"></span><br/>
</div>
</body>
</html>